package com.fsc.order;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;

/**
* @comments Program arguments:--server.port=8001 --spring.cloud.config.profile=prod
* @author  zg
* @date 2018年8月22日
*/
@EnableEurekaClient
@SpringBootApplication
@MapperScan("com.fsc.order.mapper")
@ComponentScan(basePackages = {"com.fsc"})
public class FscServiceOrderApplication {

	private static Class<?> cla = FscServiceOrderApplication.class;
	private static final Logger logger = LoggerFactory.getLogger(cla);
	
	public static void main(String[] args) {
		ConfigurableApplicationContext cofigAppCont = SpringApplication.run(cla, args);
		ConfigurableEnvironment confEnv = cofigAppCont.getEnvironment();
		String host = confEnv.getProperty("eureka.instance.hostname");
		String port = confEnv.getProperty("server.port");
		
		logger.info("FscServiceOrderApplication started on {}:{} >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", host, port);
	}
}
